package cn.com.blueInfo.bpm.number.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.number.entity.NumberRule;
import cn.com.blueInfo.bpm.number.request.NumberRuleDTO;
import cn.com.blueInfo.bpm.number.response.NumberRuleVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 编号规则定义表 对象转换
 * @author suxch
 * @since 2025-08-31 16:13:48
 */
@Mapper(componentModel = "spring")
public interface NumberRuleConvert
        extends BaseConvert<NumberRule, NumberRuleDTO, NumberRuleVO> {

    NumberRule dtoToEntity(NumberRuleDTO dto);

    NumberRule dtoToEntity(NumberRuleDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "defaultFlag", target = "defaultFlag", qualifiedByName = "enumToDesc")
    NumberRuleVO entityToVO(NumberRule entity);

}